package com.qidianit.mes.pro.mapper;

import com.qidianit.mes.pojo.Material;
import com.qidianit.mes.pro.vo.WorkflowProductCategory;
import com.qidianit.mes.pro.vo.WorkflowProductRelation;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.ArrayList;

/**
 * @Description:
 * @Author: shanzhe
 * @Date: 2025/9/19 - 15:46
 */
@Mapper
public interface WorkFlowProductMapper {
    ArrayList<WorkflowProductRelation> queryProductsByProcessCodeAndPage(@Param("page") Integer page,
                                                                         @Param("size") Integer size,
                                                                         @Param("workflowId") Integer workflowId);
    /*
    新增查重
     */
    int addWorkFlowProductRelation(WorkflowProductRelation workflowProductRelation);

    /*
    根据productCode查id
     */
    Material queryProductByProductCode(@Param("code") String processCode);

    ArrayList<WorkflowProductRelation> queryWorkFlowProductRelationByproductCode(@Param("workflowId") Integer workflowId);

    /*
    根据工艺关联商品编号查询单个工艺关联商品信息
     */
    WorkflowProductCategory queryWorkflowAndProductsAndCategoryById(@Param("id") Integer id);

    /*
    编辑工艺关联产品信息
     */
    int updateWorkFlowProductRelation(WorkflowProductRelation workflowProductRelation);

    /*
    根据工序关联产品编号删除工序关联产品信息
     */
    int deleteWorkFlowProductRelationById(Integer id);
}
